package com.yami.shop.bean.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yami.shop.bean.vo.UltraGroupApplyVO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

/**
 * 融云群组
 *
 * @author 刘聪
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName( "tz_melt_cloud_group")
@Schema(description = "融云群组")
@Builder
public class MeltCloudGroup {

    @Schema(description = "融云群组id")
    @TableId(type = IdType.AUTO)
    private Long id;
    
    /**
     * 融云群组名称
     */
    @Schema(description = "融云群组名称")
    @TableField(value = "group_name")
    private String groupName;
    
    /**
     * 群主id
     */
    @TableField(value = "creator_user_id")
    @Schema(description = "群主id")
    private String creatorUserId;
    /**
     * 群主名称
     */
    @TableField(exist = false)
    @Schema(description = "群主名称")
    private String creatorUserName;
    /**
     * 群公告
     */
    @TableField(value = "group_announcement")
    @Schema(description = "群公告")
    private String groupAnnouncement;
    
    /**
     * 群禁言状态
     */
    @TableField(value = "group_status")
    @Schema(description = "群禁言状态")
    private String groupStatus;

    @Schema(description = "0：普通群 1：超级群聊")
    @TableField(value = "type")
    private String type;

    /**
     * 创建日期
     */
    @TableField(value = "create_date")
    @Schema(description = "创建日期")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createDate;
    
    /**
     * ***限超级群聊*** -1：全部消息通知 0：未设置为全部通知，跟随超级群的配置 1：仅针对 @ 消息进行通知 2：仅针对被具体 @用户通知 4：只接收 @所有人的 5：不接收通知
     */
    @TableField(value = "unpush_level")
    @Schema(description = "超级群免打扰级别")
    private Integer unpushLevel;

    @Schema(description = "是否官方群 默认0否，1是")
    private Integer isOfficial;

    @Schema(description = "官方群商户id，平台为0")
    private Long shopId;
    
    @Schema(description = "群聊二维码")
    @TableField(value = "group_qr_code")
    private String groupQrCode;

    @Schema(description = "群是否解散 0 正常 1已解散")
    @TableField(value = "is_dismiss")
    private String isDismiss;

    @Schema(description = "群组邀请审核开关  0 否 1是")
    @TableField(value = "is_invite")
    private String isInvite;

    @Schema(description = "普通群聊名称开关 0所有成员可修改 1仅群主或管理员可修改")
    @TableField(value = "is_revise")
    private String isRevise;
    
    @Schema(description = "群头像")
    @TableField(value = "pics")
    private String pics;

    @Schema(description = "超级群到期时间")
    @TableField(value = "expiration_time")
    private Date expirationTime;

    @Schema(description = "超级群是否欠费 默认0否 1是")
    @TableField(value = "is_arrears")
    private Integer isArrears;
    
    @Schema(description = "是否公开 默认0公开  1不公开")
    @TableField(value = "not_public")
    private Integer notPublic;
    
    @Schema(description = "超级群封面图")
    @TableField(value = "cover_img")
    private String coverImg;
    
    
    /**
     * 用户群昵称
     */
    @Schema(description = "用户群昵称")
    @TableField(exist = false)
    private String userGroupNickName;

    /**
     * 群成员列表
     */
    @TableField(exist = false)
    @Schema(description = "群成员")
    private List<MeltCloudUser> users;

    @Schema(description = "自己是否推出 0 正常 1退出")
    @TableField(exist = false)
    private String isDismissMy;

    @Schema(description = "频道id")
    @TableField(exist = false)
    private String channelId;
    
    @Schema(description = "备注")
    @TableField(exist = false)
    private String groupRemark;

    @Schema(description = "商家名称")
    @TableField(exist = false)
    private String shopName;

    @TableField(exist = false)
    private UltraGroupApplyVO applyVO;
    
    
}
